#!/usr/bin/python2.4
# -*- coding: UTF-8 -*-

# subversion info:
# $HeadURL: $
# $Author: $
# $Id: $
# $Revision: $

from distutils.core import setup
import os
import sys
import setuptools


class doc(setuptools.Command):
  description = 'Create the package\'s documentation'
  user_options = []
  doc_src = "Abacum"
  doc_dst = "doc"
  excepciones = ['__init__.py'] # Not for document

  def initialize_options(self):
    pass

  def finalize_options(self):
    pass

  def run(self):
    try:
      import pydoc
    except:
      print 'pydoc unavailable'
      sys.exit(256)

    os.chdir(self.doc_dst)
    print 'Generating doc for %s...' % self.doc_src, \
        pydoc.writedoc(self.doc_src)
    for file in os.listdir('../%s' % self.doc_src):
      if file.split('.')[-1] == 'py' and file not in self.excepciones:
        print 'Generating doc for %s...' % file,
        pydoc.writedoc('%s.%s' % (self.doc_src, file.split('.')[0]))

setup (
    cmdclass = {"doc": doc},
    name = 'Abacum',
    version = '0.1',
    description = 'Robotic visual programming suite',
    author = 'Rafael Treviño Menéndez',
    author_email = 'skasi.7@gmail.com',
    license='GPL v2',
    platforms='UNIX',
    packages = ['Abacum']
    # scripts=[]
)


